import java.util.Arrays;
public class ArraysTest{
	public static void main(String[] args) {
		// 1。声明一个10，20，30，40，50的数组
		int[] arr1 = {50,20,30,40,10};
		//2.打印数组如下[10，20，30，40，50];
		System.out.print("[");
		for (int i = 0;i < arr1.length ; i++ ) { 
			if (i == (arr1.length - 1)) {
				System.out.print(arr1[i]);
			}else{
				System.out.print(arr1[i] + ",");
			}
		}
		System.out.print("]		");
		System.out.println();
		//3.使用工具类打印数组
		int[] arr2 = new int[10];
		//数组转字符串
		System.out.println(Arrays.toString(arr2));
		//数组填充
		Arrays.fill(arr2, 10);
		System.out.println(Arrays.toString(arr2));
		//数组比较
		boolean equals = Arrays.equals(arr1,arr2);
		System.out.println(equals);
		//数组排序
		Arrays.sort(arr1);
		System.out.println(Arrays.toString(arr1));
		//参数查找
		int pos = Arrays.binarySearch(arr1,20);
		System.out.println(pos);
	}
}